package co.yixiang.modules.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author seven
 * @Package co.yixiang.modules.system.enums
 * @date 2020/9/1 10:35
 */
@Getter
@AllArgsConstructor
public enum AuditStatusEnum {


    /**
     * 审核中
     */
    DEFAULT(0,"0","审核中"),

    /**
     * 通过
     *
     * via
     * */
    PASS(1,"1","通过"),
    /**
     * 驳回
     *
     * */
    REJECT(2,"2","驳回");

    private Integer code;

    private String value;

    private String desc;

    public static AuditStatusEnum toType(String value) {
        return Stream.of(AuditStatusEnum.values())
                .filter(p -> p.value.equals(value))
                .findAny()
                .orElse(null);
    }

    public String value() {
        return this.value;
    }

    public Integer code() {
        return this.code;
    }
}
